package com.homework;

public class demo10 {
    public static void main(String[] args) {
        int[][] arr = new int[][]{{11, 22, 33}, {44, 55, 66}, {77, 88, 99}, {11, 22, 33}};
        //定义一个新数组，来存储arr每个一维数组的和
        int[] arrAdd = new int[arr.length];
        //遍历数组arr
        for (int i = 0; i < arr.length; i++) {
            //每组一维数组重新定义sum
            int sum = 0;
            //遍历一维数组求和
            for (int i1 = 0; i1 < arr[i].length; i1++) {
                sum += arr[i][i1];
            }
            //将每组一维数组的总和赋值给数组arrAdd
            arrAdd[i] = sum;
        }
        //遍历arrAdd，按要求打印
        for (int j = 0; j < arrAdd.length; j++) {
            System.out.println("第"+(j+1)+"个季度的营业额为："+arrAdd[j]);
        }
    }
}
